#ifndef COMPUTING_PERCEPTION_LIDAR_PROCESS_HEADING_H
#define COMPUTING_PERCEPTION_LIDAR_PROCESS_HEADING_H

#include <limits>
#include <vector>
#include <memory>
#include <iostream>
#include "common/algorithm_type/lidar_cell_objs_type.h"
#include "common/algorithm_type/lidar_cell_type.h"
namespace perception
{
    namespace algorithm
    {
        class Heading
        {
        public:
            /// The construct methord of the class Classify.
            Heading();
            ~Heading();
            float Compute(std::vector<data_cell> &cells);
            void CoordinateTransformation(std::vector<data_cell> &cells, float &rad);

        private:
            float rad = 0;
            float drad = 10; // 度 航向每一次的变化
            // const double deg2rad = M_PI_2 / 90.0;
            float GetBestRad(std::vector<data_cell> &cells);
            float ComputeVariance(std::vector<data_cell> &cells, data_cell &mean);
            float GetHeading(std::vector<data_cell> &cells);
            void ComputeMean(std::vector<data_cell> &cells, data_cell &mean);
        };
    } // namespace perception
} // namespace avos
#endif // COMPUTING_PERCEPTION_LIDAR_PROCESS_CLASSIFY_CLASSIFY_H